package com.kathryn.LG;

import java.util.ArrayList;

import com.demo.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter {
	private Context mContext;
	public ArrayList<MyList> serialList = new ArrayList<MyList>();

	public ImageAdapter(Context mContext, ArrayList<MyList> serialList) {
		this.mContext = mContext;
		this.serialList = serialList;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return serialList.size();
	}

	@Override
	public Object getItem(int i) {
		// TODO Auto-generated method stub
		return serialList.get(i);
	}

	@Override
	public long getItemId(int i) {
		// TODO Auto-generated method stub
		return i;
	}
	@Override
	public View getView(int position, View convertview, ViewGroup viewgroup) {
		View view = LayoutInflater.from(mContext).inflate(
				R.layout.gallery_item, null);
		ImageView image = (ImageView) view.findViewById(R.id.image);
		image.setBackgroundResource(R.drawable.image1+position);
		return view;
	}

}